<?php
$baseDir = dirname(dirname(dirname(dirname(__FILE__))));
set_include_path(get_include_path().PATH_SEPARATOR.$baseDir.PATH_SEPARATOR.$baseDir.'/incubator');

include '../../testingfunctions.php';
include 'Pone/Database/Pone_Database_NamedParameterParser.php';

$query = 'INSERT INTO table (name, address, age, description) VALUES ( -- No new :eage
:name, ?, :age, \'No idea, :hello_there ? which is ?not new \')';
$namedParameterQuery = Pone_Database_NamedParameterParser::rewriteSqlStatement($query);

$query1 = 'INSERT INTO table (name, address, age, description) VALUES ( -- No new :eage
?, ?, ?, \'No idea, :hello_there ? which is ?not new \')';

assertTrue($namedParameterQuery->rewrittenQuery === $query1, 'Expected: <pre>'.$query.'</pre> is rewritten to <pre>'.$query1.'</pre>. ');
?>